﻿<%@ WebHandler Language="C#" Class="ManagerialKeyBehaviourDetailLoad" %>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using Assesment.Library.DataAccess.Administration.Catalog;
using SIPO.Library.DomainObject.Administration.Catalog;
using Assesment.Library.Enum;
using Assesment.Web.Support;
using Newtonsoft.Json.Linq;
using Assesment.Library.DomainObject.Administration.Catalog;

  public class ManagerialKeyBehaviourDetailLoad :  Assesment.Web.BaseHandler {

        ManagerialKeyBehaviourDetailRepo ManagerialKeyBehaviourDetailDal = new ManagerialKeyBehaviourDetailRepo(ConfigurationManager.ConnectionStrings["AssesmentConn"].ConnectionString);
        KeyBehaviourRepo KeyBehaviourDal = new KeyBehaviourRepo(ConfigurationManager.ConnectionStrings["AssesmentConn"].ConnectionString);
        string MethodName = string.Empty;
        
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);

            if (context.Request.Params["method"] != null)
                MethodName = context.Request.Params["method"];


            if (MethodName == "getbykeyManagerialKeyBehaviourID")
            {
                int ManagerialKeyBehaviourID = Convert.ToInt32(context.Request.Params["ManagerialKeyBehaviourID"].ToString());

                List<ManagerialKeyBehaviourDetail> list = ManagerialKeyBehaviourDetailDal.GetListByManagerialKeyBehaviourID(ManagerialKeyBehaviourID);
                var result = list;
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
            }


            if (MethodName == "getbyPositionID_CompetencyDesc")
            {
                int PositionID = Convert.ToInt32(context.Request.Params["PositionID"].ToString());
                string CompetencyDesc = context.Request.Params["CompetencyDesc"].ToString();

                List<ManagerialKeyBehaviourDetail> list = ManagerialKeyBehaviourDetailDal.GetListByPositionID_CompetencyDesc(PositionID,CompetencyDesc);
                var result = list;
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
            }


           
            
            }

       
        public override bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }

